home *** CD-ROM | disk | FTP | other *** search
- SUB picsave (Nam$,WindowNr%,ArrayYN%) STATIC
- IF ArrayYN%=1 THEN SHARED Colors%()
- IF ArrayYN%=0 THEN
- IF Colors%(0,0)<>2 THEN ERASE Colors% : DIM Colors%(31,2)
- RESTORE ColorTable
- FOR x=0 TO 31
- READ Colors%(x,0),Colors%(x,1),Colors%(x,2)
- NEXT x
- ColorTable:
- DATA 2,3,10, 15,15,15, 0,0,0, 15,8,0
- DATA 0,0,15, 15,0,15, 0,15,15, 15,15,15
- DATA 6,1,1, 14,5,0, 8,15,0, 14,11,0
- DATA 5,5,15, 9,0,15, 0,15,9, 12,12,12
- DATA 0,0,0, 13,0,0, 0,0,0, 15,12,10
- DATA 4,4,4, 5,5,5, 6,6,6, 7,7,7
- DATA 8,8,8, 9,9,9, 10,10,10, 11,11,11
- DATA 12,12,12, 13,13,13, 14,14,14, 15,15,15
- END IF
- IF Nam$="" THEN EXIT SUB
- AltWindowNr=WINDOW(1)
- WINDOW WindowNr%
- Wide=WINDOW(2)
- IF Wide>320 THEN
- Wide=640
- Resolution=2
- Planes=16000
- ELSE
- Wide=320
- Resolution=1
- Planes=8000
- END IF
- Height=WINDOW(3)
- IF Height>200 THEN
- Height=400
- Planes=Planes*2
- Resolution=Resolution+2
- ELSE
- Height=200
- END IF
- Colors=LOG(WINDOW(6)+1)/LOG(2)
-
- OPEN Nam$ FOR OUTPUT AS 1 LEN=FRE(0)-500
- PRINT #1,"FORM";
- PRINT #1,MKL$(156+Planes*Colors);
- PRINT #1,"ILBM";
- PRINT #1,"BMHD";MKL$(20);
- PRINT #1,MKI$(Wide);MKI$(Height);
- PRINT #1,MKL$(0);
- PRINT #1,CHR$(Colors);
- PRINT #1,CHR$(0);MKI$(0);MKI$(0);
- PRINT #1,CHR$(10);CHR$(11);
- PRINT #1,MKI$(Wide);MKI$(Height);
-
- PRINT #1,"CMAP";MKL$(96);
- FOR x=0 TO 31
- PRINT #1,CHR$(Colors%(x,0)*16);
- PRINT #1,CHR$(Colors%(x,1)*16);
- PRINT #1,CHR$(Colors%(x,2)*16);
- NEXT x
-
- PRINT #1,"BODY";MKL$(Planes*Colors);
- Addr=PEEKL(WINDOW(8)+4)+8
- FOR x=0 TO Colors-1
- PlaneAddr(x)=PEEKL(Addr+4*x)
- NEXT x
- FOR y1=0 TO Height-1
- FOR b=0 TO Colors-1
- FOR x1=0 TO (Wide/32)-1
- PRINT#1,MKL$(PEEKL(PlaneAddr(b)+4*x1+(Wide/8)*y1));
- NEXT x1
- NEXT b
- PAddr=PlaneAddr(0)+(Wide/8)*y1
- POKE PAddr,PEEK(PAddr) AND 63
- POKE PAddr+Wide/8-1,PEEK(PAddr+Wide/8-1) AND 252
- NEXT y1
-
- PRINT #1,"CAMG";MKL$(4);
- PRINT #1,MKL$(16384);
- CLOSE 1
- WINDOW AltWindowNr
- END SUB
-